<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html xmlns:th="http://www.thymeleaf.org">
<!--<![endif]-->
<!-- BEGIN HEAD -->

<head>
    <meta charset="utf-8" />
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="../superui/content/ui/global/bootstrap/css/bootstrap.min.css"
          th:href="@{/superui/content/ui/global/bootstrap/css/bootstrap.min.css}"/>
    <!-- select2 -->
    <link rel="stylesheet" href="../superui/content/plugins/select2/select2.min.css"
          th:href="@{/superui/content/plugins/select2/select2.min.css}"/>

    <!-- Font Awesome -->
    <link rel="stylesheet" href="../superui/content/ui/global/font-awesome/css/font-awesome.css"
          th:href="@{/superui/content/ui/global/font-awesome/css/font-awesome.css}"/>
    <!-- Theme style -->
    <link rel="stylesheet" href="../superui/content/adminlte/dist/css/AdminLTE.css"
          th:href="@{/superui/content/adminlte/dist/css/AdminLTE.css}"/>
    <link rel="stylesheet" href="../superui/content/adminlte/dist/css/skins/_all-skins.min.css"
          th:href="@{/superui/content/adminlte/dist/css/skins/_all-skins.min.css}"/>
    <link rel="stylesheet" href="../superui/content/min/css/supershopui.common.min.css"
          th:href="@{/superui/content/min/css/supershopui.common.min.css}"/>
    <link rel="stylesheet" href="../superui/content/plugins/bootstrap-table/bootstrap-table.css"
          th:href="@{/superui/content/plugins/bootstrap-table/bootstrap-table.css}"/>
    <link rel="stylesheet" href="../css/global.css"
          th:href="@{/css/global.css}"/>
    <!--全局通用框架样式 end-->
    <!-- iCheck -->
    <link rel="stylesheet" href="../superui/content/plugins/iCheck/square/blue.css"
          th:href="@{/superui/content/plugins/iCheck/square/blue.css}"/>
    <!--bootsrtap日历控件脚本-->
    <link rel="stylesheet" href="../../js/assets/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css"
          th:href="@{/js/assets/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css}">
    <!-- Bootstrap time Picker -->
    <link rel="stylesheet" href="../superui/content/plugins/timepicker/bootstrap-timepicker.min.css"
          th:href="@{/superui/content/plugins/timepicker/bootstrap-timepicker.min.css}"/>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .select2-container{
            z-index:9999999999;
        }
        .select2-search__field{
            width: 100%;
        }
    </style>

</head>
<body>
<section class="content-header">
    <h1>
        活动管理
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
        <li><a href="#">系统管理</a></li>
        <li class="active">活动管理</li>
    </ol>
</section>
<!-- Main content -->
<section class="content">

    <div class="row">
        <!-- BEGIN SAMPLE TABLE PORTLET-->
        <div class="col-md-12">
            <!-- BEGIN SAMPLE TABLE PORTLET-->
            <div class="box-body">
                <div class="panel panel-default no-margin">
                    <div class="panel-body search-box">
                        <form id="formSearch" class="form-horizontal">
                            <div class="col-md-4">
                                <div class="form-group">
                                    <label for="txt_search_activityname" class="col-sm-3 control-label">活动名称</label>
                                    <div class="col-sm-9">
                                        <input id="txt_search_activityname" name="activityname" class="form-control" type="text" value="" placeholder="请输入活动名称">
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label"></label>
                                    <div class="col-sm-9">
                                        <button type="button" class="btn btn-default" id="btn-search" onclick="clickSearch()">
                                            <i class="fa  fa-search"></i>
                                            查询
                                        </button>
                                    </div>
                                </div>
                            </div>


                        </form>
                    </div>
                </div>

                <div id="activityTableToolbar" class="btn-group">
                    <button id="btn_add" type="button" class="btn btn-primary" onclick="clickAddBtn()">
                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
                    </button>
                </div>
                <div class="table-scrollable">
                    <table class="table-striped table-hover" id="activityTable">

                    </table>
                </div>
            </div>
            <!-- END SAMPLE TABLE PORTLET-->

            <div id="activityDialog" class="hide">
                <form id="frmMain" class="form-horizontal">
                    <div class="box-body" style="width: 99%">
                        <input type="hidden" id="id" name="id" value="">
                        <div class="form-group">
                            <label for="activityName" class="col-sm-3 control-label necessary">活动名称</label>
                            <div class="col-sm-5">
                                <input type="text" class="form-control" id="activityName" name="activityName" placeholder="请输入活动名称"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="activityType" class="col-sm-3 control-label necessary">活动类型</label>
                            <div class="col-sm-7">
                                <label class="control-label">
                                    <input type="radio" name="activityType" id="activityType" class="square-green iCheck" value="1" checked>
                                    优惠活动
                                </label> &nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="discountType" class="col-sm-3 control-label necessary">折扣类型</label>
                            <div id="discountType" class="col-sm-2">
                                <label class="control-label">
                                    <input type="radio" name="discountType" id="discountType1" class="square-green iCheck" value="1"
                                           checked> 折扣
                                </label> &nbsp;
                                <label class="control-label">
                                    <input type="radio" name="discountType" id="discountType2" class="square-green iCheck" value="2"> 一口价
                                </label>
                            </div>
                            <label for="discount" class="col-sm-1 control-label necessary discount">折扣程度</label>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <input type="text" class="form-control" id="discount" name="discount" maxlength="11" placeholder="请输入折扣程度" />
                                    <span class="input-group-addon" id="discountUnit">折</span>
                                </div>
                            </div>
                        </div>

                        <!--<div class="form-group discount" style="display: none;">-->
                            <!--<label for="discount" class="col-sm-3 control-label necessary">一口价</label>-->
                            <!--<div class="col-sm-4">-->
                                <!--<div class="input-group">-->
                                    <!--<input type="text" class="form-control" id="discount" name="discount" maxlength="11" placeholder="请输入一口价" />-->
                                    <!--<span class="input-group-addon" id="discountUnit">元</span>-->
                                <!--</div>-->
                            <!--</div>-->
                        <!--</div>-->

                        <div class="form-group">
                            <label for="activityTimeStart" class="col-sm-3 control-label necessary">活动开始时间</label>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <input type="text" class="form-control form_date_start" id="activityTimeStart" name="activityTimeStart"
                                           readonly placeholder="请选择开始时间">
                                    <div class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                </div>
                            </div>
                            <label for="activityTimeEnd" class="col-sm-1 control-label necessary">活动结束时间</label>
                            <div class="col-sm-2">
                                <div class="input-group">
                                    <input type="text" class="form-control form_date_end" id="activityTimeEnd" name="activityTimeEnd"
                                           readonly
                                           placeholder="请选择结束时间"/>
                                    <div class="input-group-addon">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="instruction" class="col-sm-3 control-label">活动说明</label>
                            <div class="col-sm-9">
                                <textarea class="form-control" id="instruction" name="instruction" rows="4"
                                          placeholder="请输入活动介绍..."></textarea>
                            </div>
                        </div>
                    </div>

                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">关联课程</h3>
                            <span style="margin-left: 3%; color: #ff4624;">(取消关联后请点击保存按钮确认删除)</span>
                            <!--批量绑定按钮-->
                            <div class="btn-group pull-right" style="margin-right: 30px">
                                <button id="btn_batch" type="button" class="btn btn-primary" onclick="clickBatchBtn()">
                                    <span class="fa fa-share-square-o" aria-hidden="true"></span>批量关联课程
                                </button>
                            </div>

                            <div class="form-group pull-right" style="margin-right: 30px">
                                <div class="col-sm-6">
                                    <div class="input-group">
                                        <select class="select2" name="course" id="course" style="width: 420px"></select>
                                    </div>
                                </div>
                            </div>

                            <div class="box-tools pull-right">
                                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                            </div>
                        </div>
                        <div class="box-body" style="max-height: 300px;overflow-y: auto;">
                            <table id="dt-inspection-content" class="table table-bordered table-striped table-hover">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>课程名称</th>
                                        <th>课程总价</th>
                                        <th>课程结束时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="courseTableBody">

                                </tbody>
                            </table>
                        </div>
                    </div>
                </form>
            </div><!-- /.modal -->

            <!--批量绑定弹出框-->
            <div id="activityBatchDialog" class="hide">
                <div class="box-body">
                    <div class="panel panel-default no-margin">
                        <div class="panel-body search-box">
                            <form id="formSearch1" class="form-horizontal">

                                <div class="form-group fl" style="width: 350px;margin-right: 10px">
                                    <label for="txt_search_courseClass" class="col-sm-4 control-label">大类：</label>
                                    <div class="col-sm-8">
                                        <select id="txt_search_courseClass" name="courseClass" class="form-control">
                                            <option value=""> --请选择--</option>
                                            <option value="1"> 课外辅导</option>
                                            <option value="2"> 研学旅行</option>
                                            <option value="3"> 冬夏令营</option>
                                            <option value="4"> 线上辅导</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group fl" style="width: 350px;margin-right: 10px">
                                    <label for="txt_search_courseGrade" class="col-sm-4 control-label">年级：</label>
                                    <div class="col-sm-8">
                                        <select id="txt_search_courseGrade" name="courseGrade" class="form-control">
                                            <option value="">--请选择--</option>
                                            <option value="1">一年级</option>
                                            <option value="2">二年级</option>
                                            <option value="3">三年级</option>
                                            <option value="4">四年级</option>
                                            <option value="5">五年级</option>
                                            <option value="6">六年级</option>
                                            <option value="7">小升初</option>
                                            <option value="8">初一</option>
                                            <option value="9">初二</option>
                                            <option value="10">初三</option>
                                            <option value="11">初升高</option>
                                            <option value="12">高一</option>
                                            <option value="13">高二</option>
                                            <option value="14">高三</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group fl" style="width: 350px;margin-right: 10px">
                                    <label for="txt_search_classType" class="col-sm-4 control-label">科目：</label>
                                    <div class="col-sm-8">
                                        <select id="txt_search_classType" name="classTypeId" class="form-control">

                                        </select>
                                    </div>
                                </div>

                                <div class="form-group fl" style="width: 350px;margin-right: 10px">
                                    <label for="txt_search_school" class="col-sm-4 control-label">校区：</label>
                                    <div class="col-sm-8">
                                        <select id="txt_search_school" name="school" class="form-control">

                                        </select>
                                    </div>
                                </div>

                                <div class="form-group fl" style="width: 350px; margin-right: 10px">
                                    <label class="col-sm-4 control-label"></label>
                                    <div class="col-sm-8">
                                        <button type="button" class="btn btn-default" id="btn_search" onclick="ActivityBatchInfoDlg.clickSearch_conurse()">
                                            <i class="fa  fa-search"></i>
                                            查询
                                        </button> &nbsp;&nbsp;&nbsp;
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>

                    <div class="table-scrollable">
                        <table class="table-striped table-hover" id="courseTable">

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

</section>
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 2.2.3 -->
<script src="../superui/content/ui/global/jQuery/jquery.min.js"></script>
<!-- Bootstrap 3.3.6 -->

<script src="../superui/content/ui/global/bootstrap/js/bootstrap.min.js"
        th:src="@{/superui/content/ui/global/bootstrap/js/bootstrap.min.js}"></script>
<!--supershopui-->
<script src="../superui/content/min/js/supershopui.common.js"
        th:src="@{/superui/content/min/js/supershopui.common.js}"></script>
<!-- select2 -->
<script src="../superui/content/plugins/select2/select2.js"
        th:src="@{/superui/content/plugins/select2/select2.js}"></script>
<script src="../superui/content/plugins/select2/i18n/zh-CN.js"
        th:src="@{/superui/content/plugins/select2/i18n/zh-CN.js}"></script>
<!--bootstrap-table-->
<script src="../superui/content/plugins/bootstrap-table/bootstrap-table.js"
        th:src="@{/superui/content/plugins/bootstrap-table/bootstrap-table.js}"></script>
<script src="../superui/content/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"
        th:src="@{/superui/content/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js}"></script>
<script src="../js/assets/common/bootstrap-table-object.js"
        th:src="@{/js/assets/common/bootstrap-table-object.js}"></script>
<!-- iCheck -->
<script src="../superui/content/plugins/iCheck/icheck.min.js"
        th:src="@{/superui/content/plugins/iCheck/icheck.min.js}"></script>


<script src="./../../js/assets/common/Feng.js"
        th:src="@{/js/assets/common/Feng.js}"></script>

<script src="./../../js/assets/common/ajax-util.js"
        th:src="@{/js/assets/common/ajax-util.js}"></script>
<!-- 请求脚本-->
<script src="./../../js/assets/common/common.js"
        th:src="@{/js/assets/common/common.js}"></script>

<!--bootsrtap日历控件脚本-->
<script src="../../js/assets/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"
        th:src="@{/js/assets/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js}"></script>
<script src="../../js/assets/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"
        th:src="@{/js/assets/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
<script src="../../js/assets/lib/bootstrap-datetimepicker/js/initDatetimepicker.js"
        th:src="@{/js/assets/lib/bootstrap-datetimepicker/js/initDatetimepicker.js}"></script>

<!-- 模板引擎-->
<script src="../../js/assets/lib/artTemplate/template.js"
        th:src="@{/js/assets/lib/artTemplate/template.js}"></script>
<!-- 活动脚本-->
<script src="./../../js/admin/activity/activity.js"
        th:src="@{/js/admin/activity/activity.js}"></script>
<script src="./../../js/admin/activity/activity_info.js"
        th:src="@{/js/admin/activity/activity_info.js}"></script>
<script src="./../../js/admin/activity/activity_batch.js"
        th:src="@{/js/admin/activity/activity_batch.js}"></script>

<!-- 课程表格模板 -->
<script type="text/html" id="dataInspectionContentTmpl">
    {{each}}
    <tr>
        <td>{{$index+1}}</td>
        <td>{{$value.courseName||"无"}}</td>
        <td>{{$value.coursePrice}}</td>
        <td>{{$value.courseEndDate}}</td>
        <td data-id="{{$value.courseId || $index}}">
            <a title="删除" href="#" onclick="ActivityInfoDlg.deleteCourse('{{$value.courseId}}')" data-target="delete">取消关联</a>
        </td>
    </tr>
    {{/each}}
</script>
</body>
</html>